package com.zhangyusheng.easyecharts.component;


import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * TODO: X轴
 *
 * @author Michael zhang
 * @email zhangys_0217@sina.com
 * @since 2025年11月03日
 */
@Data
@Accessors(chain = true)
public class XAxis implements Serializable {
    private final static long serialVersionUID = 2L;

    private boolean show;
    /**
     *  赋值参考枚举：TypeEnum
     */
    private String type;
    private String position;
    private boolean boundaryGap;
    /**
      x轴 类目数据
     **/
    private List<String> data;

    private SplitLine splitLine;

    public static class Builder{
        private boolean show = true;
        private String position;
        private String type;
        private boolean boundaryGap =  true;
        private List<String> data;
        private SplitLine splitLine;


        public Builder show(boolean show){
            this.show = show;
            return this;
        }
        public Builder type(String type){
            this.type = type;
            return this;
        }
        public Builder boundaryGap(boolean boundaryGap){
            this.boundaryGap = boundaryGap;
            return this;
        }
        public Builder data(List<String> data){
            this.data = data;
            return this;
        }
        public Builder splitLine(SplitLine splitLine){
            this.splitLine = splitLine;
            return this;
        }
        public Builder position(String position){
            this.position = position;
            return this;
        }
        public XAxis build(){
            return new XAxis(this);
        }
    }
    private XAxis(Builder builder){
        this.show = builder.show;
        this.type = builder.type;
        this.data = builder.data;
        this.boundaryGap = builder.boundaryGap;
        this.splitLine = builder.splitLine;
        this.position = builder.position;
    }




}
